package com.yq.testmodule.barrage

import android.widget.TextView
import base.BaseActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.yq.testmodule.R
import com.yq.testmodule.barrage.VerticalBarrageView
import config.TEST_BARRAGE

import config.TEST_LAYOUT_MANAGE


@Route(path = TEST_BARRAGE)
class TestBarrageViewActivity : BaseActivity() {
    override fun initLayout(): Int {
        return R.layout.activity_test_barrage
    }

    lateinit var mRv: VerticalBarrageView
    override fun initView() {
        var temp = true
        findViewById<TextView>(R.id.tvTest).setOnClickListener {
            temp = !temp
            if(temp){
                mRv.startScroller()
            }else{
                mRv.destory()
            }
        }
        mRv = findViewById(R.id.rvTest)

        mockData()
    }

    val barrageData = arrayListOf<String>()


    private fun mockData() {
        for (i in 0..30) {
            barrageData.add(i.toString())
        }
        mRv.initData(barrageData)


    }


    override fun initData() {

    }
}